import unittest
import asyncio
import websockets

class TestWebSocketServer(unittest.TestCase):

    async def connect_and_test(self, uri):
        async with websockets.connect(uri) as websocket:
            message = "Hello, Server!"
            await websocket.send(message)
            response = await websocket.recv()
            self.assertEqual(response, f"Echo: {message}")

    def test_echo(self):
        uri = "ws://localhost:8765"
        loop = asyncio.get_event_loop()
        loop.run_until_complete(self.connect_and_test(uri))

if __name__ == "__main__":
    unittest.main()